﻿Imports System.Data.SqlClient

Public Class ContactToSQLParameterConverter

    Public Function GetUpdateParameterList(Contact As Contact) As List(Of SqlParameter)
        Dim parameters As New List(Of SqlParameter)

        parameters.Add(New SqlParameter("@ID", Contact.ID))
        parameters.Add(New SqlParameter("@Name", Contact.Name))
        parameters.Add(New SqlParameter("@Title", Contact.Title))
        parameters.Add(New SqlParameter("@PhoneNumber", Contact.PhoneNumber))
        parameters.Add(New SqlParameter("@Email", Contact.Email))
        parameters.Add(New SqlParameter("@CellPhone", Contact.CellPhoneNumber))
        parameters.Add(New SqlParameter("@ContentItemID", Contact.ContentItemId))
        parameters.Add(New SqlParameter("@ModuleID", Contact.ModuleID))

        Return parameters
    End Function

    Public Function GetInsertParameterList(Contact As Contact) As List(Of SqlParameter)
        Dim parameters As New List(Of SqlParameter)

        parameters.Add(New SqlParameter("@Name", Contact.Name))
        parameters.Add(New SqlParameter("@Title", Contact.Title))
        parameters.Add(New SqlParameter("@PhoneNumber", Contact.PhoneNumber))
        parameters.Add(New SqlParameter("@Email", Contact.Email))
        parameters.Add(New SqlParameter("@CellPhone", Contact.CellPhoneNumber))
        parameters.Add(New SqlParameter("@ContentItemID", Contact.ContentItemId))
        parameters.Add(New SqlParameter("@ModuleID", Contact.ModuleID))

        Return parameters
    End Function
End Class